﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate.Mappings;

namespace Apollo
{
    [NHibernateEntity(Table = "Payments", Lazy = true)]
    public class Payment : ILegacy
    {
        public Payment() { }

        [PrimaryKey]
        public virtual int Id { get; set; }

        [Property]
        public virtual string Name { get; set; }

        [BelongsTo(Column = "ID_Contract")]
        public virtual Contract Contract { get; set; }

        [BelongsTo(Column = "ID_PaidBy_Contact")]
        public virtual Contact PaidBy { get; set; }

        [BelongsTo(Column = "ID_TimeTableItem")]
        public virtual TimeTableItem TimeTableItem { get; set; }

        [Property]
        public virtual DateTime PaidDate { get; set; }

        [Property]
        public virtual DateTime AllocationDate { get; set; }

        [Property]
        public virtual double GrossValue { get; set; }

        [BelongsTo(Column = "ID_Currency")]
        public virtual Currency Currency { get; set; }

        [Property]
        public virtual string LegacyApplication { get; set; }

        [Property]
        public virtual string LegacyID { get; set; }

        [Property]
        public virtual State State { get; set; }
    }

    public enum PaymentType { 
        Cash = 0,
        Card = 1,
        PaymentOrder = 2,
        Promissory = 3,
    }

    public enum PaymentFrequency { 
        Once = 0,
        L = 12,
        T = 4,
        S = 2,
        A = 1,
    }
}
